// Package member
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2023 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
package member

import (
	"context"
	"hotgo/api/api/member"
	"hotgo/internal/dao"
	"hotgo/internal/library/contexts"
)

var (
	Member = cMember{}
)

type cMember struct{}

func (c *cMember) GetUser(ctx context.Context, req *member.GetUserReq) (res *member.GetUserRes, err error) {
	res = new(member.GetUserRes)
	userId := contexts.GetUserId(ctx)
	userRecord, _ := dao.EpMember.Ctx(ctx).WherePri(userId).One()
	userMap := userRecord.Map()
	userMap["order_num"] = 0
	res.Data = userMap
	return
}

//获取用户地址列表
